package com.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.entity.MeishiRatingEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 健康食谱评分 Dao 接口
 *
 * @author
 */
@Mapper
public interface MeishiRatingDao extends BaseMapper<MeishiRatingEntity> {
    @Select("SELECT yonghu_id, meishi_id, rating FROM meishi_rating")
    List<Map<String, Object>> findAllRatings();

    @Select("SELECT meishi_id, rating FROM meishi_rating WHERE yonghu_id = #{userId}")
    List<Map<String, Object>> findRatingsByUserId(@Param("userId") String userId);
}
